3.60 \(\int (f+g x) (A+B \log (e (\frac{a+b x}{c+d x})^n)) \, dx\)

Optimal. Leaf size=115 \[ \frac{(f+g x)^2 \left (B \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+A\right )}{2 g}-\frac{B n (b f-a g)^2 \log (a+b x)}{2 b^2 g}-\frac{B g n x (b c-a d)}{2 b d}+\frac{B n (d f-c g)^2 \log (c+d x)}{2 d^2 g} \]

[Out]

-(B*(b*c - a*d)*g*n*x)/(2*b*d) - (B*(b*f - a*g)^2*n*Log[a + b*x])/(2*b^2*g) + ((f + g*x)^2*(A + B*Log[e*((a +
b*x)/(c + d*x))^n]))/(2*g) + (B*(d*f - c*g)^2*n*Log[c + d*x])/(2*d^2*g)

________________________________________________________________________________________

Rubi [A]  time = 0.104979, antiderivative size = 115, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.107, Rules used = {2525, 12, 72} \[ \frac{(f+g x)^2 \left (B \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+A\right )}{2 g}-\frac{B n (b f-a g)^2 \log (a+b x)}{2 b^2 g}-\frac{B g n x (b c-a d)}{2 b d}+\frac{B n (d f-c g)^2 \log (c+d x)}{2 d^2 g} \]

Antiderivative was successfully verified.

[In]

Int[(f + g*x)*(A + B*Log[e*((a + b*x)/(c + d*x))^n]),x]

[Out]

-(B*(b*c - a*d)*g*n*x)/(2*b*d) - (B*(b*f - a*g)^2*n*Log[a + b*x])/(2*b^2*g) + ((f + g*x)^2*(A + B*Log[e*((a +
b*x)/(c + d*x))^n]))/(2*g) + (B*(d*f - c*g)^2*n*Log[c + d*x])/(2*d^2*g)

Rule 2525

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Simp[((d + e*x)^(m
+ 1)*(a + b*Log[c*RFx^p])^n)/(e*(m + 1)), x] - Dist[(b*n*p)/(e*(m + 1)), Int[SimplifyIntegrand[((d + e*x)^(m +
 1)*(a + b*Log[c*RFx^p])^(n - 1)*D[RFx, x])/RFx, x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && RationalFunc
tionQ[RFx, x] && IGtQ[n, 0] && (EqQ[n, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin{align*} \int (f+g x) \left (A+B \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )\right ) \, dx &=\frac{(f+g x)^2 \left (A+B \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )\right )}{2 g}-\frac{(B n) \int \frac{(b c-a d) (f+g x)^2}{(a+b x) (c+d x)} \, dx}{2 g}\\ &=\frac{(f+g x)^2 \left (A+B \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )\right )}{2 g}-\frac{(B (b c-a d) n) \int \frac{(f+g x)^2}{(a+b x) (c+d x)} \, dx}{2 g}\\ &=\frac{(f+g x)^2 \left (A+B \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )\right )}{2 g}-\frac{(B (b c-a d) n) \int \left (\frac{g^2}{b d}+\frac{(b f-a g)^2}{b (b c-a d) (a+b x)}+\frac{(d f-c g)^2}{d (-b c+a d) (c+d x)}\right ) \, dx}{2 g}\\ &=-\frac{B (b c-a d) g n x}{2 b d}-\frac{B (b f-a g)^2 n \log (a+b x)}{2 b^2 g}+\frac{(f+g x)^2 \left (A+B \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )\right )}{2 g}+\frac{B (d f-c g)^2 n \log (c+d x)}{2 d^2 g}\\ \end{align*}

Mathematica [A]  time = 0.128372, size = 120, normalized size = 1.04 \[ \frac{b \left (d \left (B g^2 n x (a d-b c)+A b d (f+g x)^2\right )+b B d^2 (f+g x)^2 \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+b B n (d f-c g)^2 \log (c+d x)\right )-B d^2 n (b f-a g)^2 \log (a+b x)}{2 b^2 d^2 g} \]

Antiderivative was successfully verified.

[In]

Integrate[(f + g*x)*(A + B*Log[e*((a + b*x)/(c + d*x))^n]),x]

[Out]

(-(B*d^2*(b*f - a*g)^2*n*Log[a + b*x]) + b*(d*(B*(-(b*c) + a*d)*g^2*n*x + A*b*d*(f + g*x)^2) + b*B*d^2*(f + g*
x)^2*Log[e*((a + b*x)/(c + d*x))^n] + b*B*(d*f - c*g)^2*n*Log[c + d*x]))/(2*b^2*d^2*g)

________________________________________________________________________________________

Maple [F]  time = 0.32, size = 0, normalized size = 0. \begin{align*} \int \left ( gx+f \right ) \left ( A+B\ln \left ( e \left ({\frac{bx+a}{dx+c}} \right ) ^{n} \right ) \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*x+f)*(A+B*ln(e*((b*x+a)/(d*x+c))^n)),x)

[Out]

int((g*x+f)*(A+B*ln(e*((b*x+a)/(d*x+c))^n)),x)

________________________________________________________________________________________

Maxima [A]  time = 1.09531, size = 203, normalized size = 1.77 \begin{align*} \frac{1}{2} \, B g x^{2} \log \left (e{\left (\frac{b x}{d x + c} + \frac{a}{d x + c}\right )}^{n}\right ) + \frac{1}{2} \, A g x^{2} - \frac{1}{2} \, B g n{\left (\frac{a^{2} \log \left (b x + a\right )}{b^{2}} - \frac{c^{2} \log \left (d x + c\right )}{d^{2}} + \frac{{\left (b c - a d\right )} x}{b d}\right )} + B f n{\left (\frac{a \log \left (b x + a\right )}{b} - \frac{c \log \left (d x + c\right )}{d}\right )} + B f x \log \left (e{\left (\frac{b x}{d x + c} + \frac{a}{d x + c}\right )}^{n}\right ) + A f x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x, algorithm="maxima")

[Out]

1/2*B*g*x^2*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) + 1/2*A*g*x^2 - 1/2*B*g*n*(a^2*log(b*x + a)/b^2 - c^2*log(d
*x + c)/d^2 + (b*c - a*d)*x/(b*d)) + B*f*n*(a*log(b*x + a)/b - c*log(d*x + c)/d) + B*f*x*log(e*(b*x/(d*x + c)
+ a/(d*x + c))^n) + A*f*x

________________________________________________________________________________________

Fricas [A]  time = 0.925426, size = 390, normalized size = 3.39 \begin{align*} \frac{A b^{2} d^{2} g x^{2} +{\left (2 \, B a b d^{2} f - B a^{2} d^{2} g\right )} n \log \left (b x + a\right ) -{\left (2 \, B b^{2} c d f - B b^{2} c^{2} g\right )} n \log \left (d x + c\right ) +{\left (2 \, A b^{2} d^{2} f -{\left (B b^{2} c d - B a b d^{2}\right )} g n\right )} x +{\left (B b^{2} d^{2} g x^{2} + 2 \, B b^{2} d^{2} f x\right )} \log \left (e\right ) +{\left (B b^{2} d^{2} g n x^{2} + 2 \, B b^{2} d^{2} f n x\right )} \log \left (\frac{b x + a}{d x + c}\right )}{2 \, b^{2} d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x, algorithm="fricas")

[Out]

1/2*(A*b^2*d^2*g*x^2 + (2*B*a*b*d^2*f - B*a^2*d^2*g)*n*log(b*x + a) - (2*B*b^2*c*d*f - B*b^2*c^2*g)*n*log(d*x
+ c) + (2*A*b^2*d^2*f - (B*b^2*c*d - B*a*b*d^2)*g*n)*x + (B*b^2*d^2*g*x^2 + 2*B*b^2*d^2*f*x)*log(e) + (B*b^2*d
^2*g*n*x^2 + 2*B*b^2*d^2*f*n*x)*log((b*x + a)/(d*x + c)))/(b^2*d^2)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(A+B*ln(e*((b*x+a)/(d*x+c))**n)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 5.30086, size = 182, normalized size = 1.58 \begin{align*} \frac{1}{2} \,{\left (A g + B g\right )} x^{2} + \frac{1}{2} \,{\left (B g n x^{2} + 2 \, B f n x\right )} \log \left (\frac{b x + a}{d x + c}\right ) - \frac{{\left (B b c g n - B a d g n - 2 \, A b d f - 2 \, B b d f\right )} x}{2 \, b d} + \frac{{\left (2 \, B a b f n - B a^{2} g n\right )} \log \left (b x + a\right )}{2 \, b^{2}} - \frac{{\left (2 \, B c d f n - B c^{2} g n\right )} \log \left (-d x - c\right )}{2 \, d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x, algorithm="giac")

[Out]

1/2*(A*g + B*g)*x^2 + 1/2*(B*g*n*x^2 + 2*B*f*n*x)*log((b*x + a)/(d*x + c)) - 1/2*(B*b*c*g*n - B*a*d*g*n - 2*A*
b*d*f - 2*B*b*d*f)*x/(b*d) + 1/2*(2*B*a*b*f*n - B*a^2*g*n)*log(b*x + a)/b^2 - 1/2*(2*B*c*d*f*n - B*c^2*g*n)*lo
g(-d*x - c)/d^2